include('shared.lua')

// Draw

function ENT:Draw()
	if (LocalPlayer():GetEyeTrace().Entity == self.Entity && EyePos():Distance(self.Entity:GetPos()) < 512) then
		self:DrawEntityOutline(1.0)
		
		if (self:GetOverlayText() != "") then
			AddWorldTip(self.Entity:EntIndex(), self:GetOverlayText(), 0.5, self.Entity:GetPos(), self.Entity)
		end
	end
	
	local Trace = {}
	
	Trace.start = self.Entity:GetPos()
	Trace.endpos = self.Entity:GetPos() + (self.Entity:GetUp() * self:GetEntityLength())
	Trace.filter = self.Entity

	local TR = util.TraceLine(Trace) 
	
	local Position = self.Entity:GetPos()
	
	if (self:IsEntityPressing()) then
		if (self:GetEntityEffect() == 1) then
			local Emitter = ParticleEmitter(self.Entity:GetPos())
			
			local Particle = Emitter:Add("sprites/heatwave", self.Entity:GetPos())
			
			Particle:SetVelocity(self.Entity:GetUp() * self:GetEntityLength())
			Particle:SetDieTime(1)
			Particle:SetStartAlpha(50)
			Particle:SetEndAlpha(50)
			Particle:SetStartSize(math.random(16, 32))
			Particle:SetColor(255, 255, 255)
			Particle:SetEndSize(math.random(16, 32))
			Particle:SetRoll(math.Rand(-0.2, 0.2))
			
			Emitter:Finish()
		end
	end
	
	self.Entity:DrawModel()
end